Control-Flow Functions and Statements Looping ------- FOR...NEXT Repeats statements between FOR and NEXT a specific number of times. EXIT FOR Provides an alternative way to exit a FOR...NEXT loop. DO...LOOP Repeats statements between DO and LOOP, either until a given condition is true (DO...LOOP UNTIL condition), or while a given condition is true (DO...LOOP WHILE condition). EXIT DO Provides an alternative way to exit a DO...LOOP loop. WHILE...WEND Repeats statements between WHILE and WEND while a given condition is true (similar to DO WHILE condition...LOOP). Making decisions ---------------- IF...THEN...ELSE END IF Conditionally executes or branches to different statements. SELECT CASE END SELECT Conditionally executes different statements. Managing the stack ------------------ STACK Function Returns maximum stack size that can be allocated. STACK Statement Sets stack to new size. Exiting the program ------------------- END number SYSTEM number STOP number Exit the program and set error level defined by number. If number is not present, exit the program with error level set to 0.